package com.ydh.company.controller;

import com.ydh.company.dto.ResponseData;
import com.ydh.company.dto.ResultData;
import com.ydh.company.pojo.Condition;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单统计类
 * @author ly
 * @version 1.0
 * @date 2020/5/2 17:39
 */

@RestController
@Api(tags = "订单统计测试接口API")
@RequestMapping("/orderStatistics")
public class OrderStatisticsController {

    @ApiOperation(value = "订单统计测试接口",notes = "用户查看全部的订单统计和统计项目详细信息")
    @PostMapping("/allOrder")
    public ResultData selectAllOrder(){
        return ResponseData.success("查询成功","这里是查询信息");
    }

    @ApiOperation(value = "按条件显示订单统计信息测试接口",notes = "用户输入查询的条件，返回要显示的统计信息")
    @PostMapping("/orderByCondition")
    public ResultData selectOrderByCondition(@RequestBody Condition condition){

        System.out.println(condition.getInputValue());
        if (condition.getSelectValue().equals("1")) {
            return ResponseData.success("查询成功","这里是查询信息，我还没想好");
        }
        return ResponseData.error(400,"查询失败");
    }

}
